home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_12_1986_Transactor_Publishing.d64 / kernal who.src4 < prev    next >
Text File  |  2023-02-26  |  2KB  |  53 lines

  1. ; program 4
  2. ; fetches disk status and displays on top line of screen
  3. ; when the control and commodore keys are pressed together.
  4. ;
  5. init      sei             ;interrupts off
  6. lda #h,start    ;high order byte of start
  7. sta $0315       ;change high order vector
  8. lda #l,start    ;low byte of start
  9. sta $0314       ;low byte of vector
  10. cli             ;interrupts on
  11. lda #$06        ;match value
  12. sta $fe         ;save it
  13. rts             ;return
  14. ;
  15. start     lda $028d       ;load keyboard shift pattern
  16. cmp $fe         ;6=  control+commodore key
  17. beq begin       ;if pressed then do it
  18. lda #$06        ;countdown limit
  19. cmp $fe         ;reached yet?
  20. beq exit        ;if yes then continue
  21. dec $fe         ;countdown one more jiffy
  22. exit      jmp $ea31       ;finish interrupt
  23. begin     lda #$2d        ;45 jiffys (.75 second)
  24. sta $fe         ;countdown location
  25. lda #$08        ;device number
  26. jsr $ffb4       ;talk: command disk to talk
  27. lda #$6f        ;secondary address 15
  28. jsr $ff96       ;tksa: send second
  29. bcs exit        ;error abort
  30. sec             ;set carry bit
  31. jsr $fff0       ;plot: fetch cursor location
  32. stx $fb         ;save it
  33. sty $fc         ;save it too
  34. lda #$13        ;home cursor character
  35. jsr $ffd2       ;chrout: print it
  36. lda #$00        ;a zero
  37. sta $90         ;clear the status word
  38. next      jsr $ffa5       ;acptr:  get error channel character
  39. jsr $ffd2       ;chrout: print it
  40. jsr $ffb7       ;readst: read status byte
  41. cmp #$00        ;if zero
  42. beq next        ;get another character
  43. ldx $fb         ;cursor x position
  44. lda $fc         ;cursor y 
  45. cmp #$28        ;short line?
  46. bcc goplot      ;if yes go plot
  47. sbc #$28        ;subtract 40
  48. goplot    tay             ;move to y register
  49. clc             ;clear carry
  50. jsr $fff0       ;plot: set cursor back
  51. jsr $ffab       ;untlk: untalk serial devices
  52. jmp exit        ;finish
  53.